<?php
class stFacebookToolbox_model extends stmodel_2_1{

    public function __construct($config) {
        parent::__construct ( $config );
        $this->setTableName($this->prefix.'st_stFacebookToolbox');
        $this->setPrimaryKey('id');
    }    
        
    public function savestFacebookToolbox($post) {
        $data = $post;
        $data['id'] = isset($data['id'])? $data['id']:NULL;
        if($data['id'] == NULL){
            $time = isset($data['cdate'])? $data['cdate']:date('Y-m-d H:i:s');
            $data['cdate'] = $time;
        }
        
        $data['stFacebookToolbox_picture'] = basename($data['stFacebookToolbox_picture']);
        $this->saveRecords($data);
    }
    

}